﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DmxTestTool.Model
{
    public  class DMXTestInfo:System.ComponentModel.INotifyPropertyChanged
    {
        public int sendType { set; get; } = 0;
        public int SendType
        {
            set
            {
                sendType = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SendType"));
            }
            get
            {
                return sendType;
            }
        }
        public string LocalIPEndPoint { set; get; }
        public string IP { set; get; } = "192.168.1.255";
        public int Universe { set; get; } = 0;
        private string comName { set; get; } = "com1";

        public string ComName
        {
            set
            {
                comName = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ComName"));
            }
            get
            {
                return comName;
            }
        }
        private string titleName { set; get; } = "artnet 0";

        public string TitleName
        {
            set
            {
                titleName = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TitleName"));
            }
            get
            {
                return titleName;
            }
        }
        public string OSCIPEndPoint { set; get; } = "192.168.1.255:1000";
        public int StartIndex { set; get; } = 1;
        public int EndIndex { set; get; } = 16;
        public int Frame { set; get; } = 30;
        public event PropertyChangedEventHandler PropertyChanged;
        public DMXTestInfo()
        {
            Random random = new Random();
            LocalIPEndPoint = "0.0.0.0:" + random.Next(10000,63000);
        }
    }
}
